load("@rules_rust//rust:defs.bzl", "rust_library")

package(default_visibility = ["//visibility:public"])

DEPENDENCIES = [
    # Keep sorted.
    "//rs/artifact_pool",
    "//rs/config",
    "//rs/consensus/certification",
    "//rs/consensus/dkg",
    "//rs/consensus/utils",
    "//rs/consensus/vetkd",
    "//rs/crypto/interfaces/sig_verification",
    "//rs/crypto/tls_interfaces",
    "//rs/cycles_account_manager",
    "//rs/https_outcalls/consensus",
    "//rs/ingress_manager",
    "//rs/interfaces",
    "//rs/interfaces/adapter_client",
    "//rs/interfaces/registry",
    "//rs/interfaces/state_manager",
    "//rs/monitoring/logger",
    "//rs/monitoring/metrics",
    "//rs/p2p/artifact_downloader",
    "//rs/p2p/artifact_manager",
    "//rs/p2p/consensus_manager",
    "//rs/p2p/peer_manager",
    "//rs/p2p/quic_transport",
    "//rs/p2p/state_sync_manager",
    "//rs/registry/helpers",
    "//rs/registry/subnet_type",
    "//rs/replicated_state",
    "//rs/state_manager",
    "//rs/types/types",
    "@crate_index//:slog",
    "@crate_index//:tokio",
    "@crate_index//:tower-http",
]

NONMALICIOUS_DEPENDENCIES = [
    # Keep sorted.
    "//rs/consensus:consensus",
    "//rs/consensus/idkg",
]

MALICIOUS_DEPENDENCIES = [
    # Keep sorted.
    "//rs/consensus:malicious_consensus",
    "//rs/consensus/idkg:malicious_idkg",
]

rust_library(
    name = "setup_ic_network",
    srcs = glob(["src/**"]),
    crate_name = "ic_replica_setup_ic_network",
    version = "0.9.0",
    deps = DEPENDENCIES + NONMALICIOUS_DEPENDENCIES,
)

rust_library(
    name = "malicious_setup_ic_network",
    testonly = True,
    srcs = glob(["src/**"]),
    crate_name = "ic_replica_setup_ic_network",
    version = "0.9.0",
    deps = DEPENDENCIES + MALICIOUS_DEPENDENCIES,
)
